//
//  HomeDetailViewController.m
//  W2MD
//
//  Created by zhudongwei on 14/11/2.
//  Copyright (c) 2014年 zhudongwei. All rights reserved.
//

#import "HomeDetailViewController.h"
#import "UIImageView+WebCache.h"
#import "AwesomeMenu.h"
#import "AwesomeMenuItem.h"

@interface HomeDetailViewController ()
{
    NSURL *m_url;
    int flag;
    NSString *stru;
}
@end

@implementation HomeDetailViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self.iv sd_setImageWithURL:m_url];
    
    UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
    [self.view addGestureRecognizer:tapGR];
    
    flag = 0;
    
}

-(void)tapAction:(UITapGestureRecognizer*)tapGR
{
    CGPoint point = [tapGR locationInView:self.view];
    NSLog(@"------------ %f %f",point.x,point.y);
        [self dismissViewControllerAnimated:YES completion:^{
            
        }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil withURL:(NSURL*)url withSource:(NSString*)strUrl index:(NSInteger)index
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        m_url = url;
        stru = strUrl;
    }
    return self;
}
-(IBAction)clickToSource:(id)sender
{
    if ([stru length]>0) {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:stru]];
    }
    else
    {
        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"消息" message:@"源地址连接无效" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
        [alert show];
    }

}
@end
